package cn.edu.mju.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.edu.mju.auth.mapper.IAuthUserInfoMapper;
import cn.edu.mju.auth.service.IUserInfoService;
import cn.edu.mju.common.entity.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * @author 16423
 */
@Service
public class UserInfoServiceImpl implements IUserInfoService {

    private final IAuthUserInfoMapper userInfoMapper;

    @Autowired
    public UserInfoServiceImpl(IAuthUserInfoMapper userInfoMapper) {
        this.userInfoMapper = userInfoMapper;
    }


    @Override
    public UserInfo queryByNickName(String nickName) {

        LambdaQueryWrapper<UserInfo> lqw = new LambdaQueryWrapper<>();
        lqw.eq(UserInfo::getNickName,nickName);

        return userInfoMapper.selectOne(lqw);
    }

    @Override
    public Page<UserInfo> queryByPage(UserInfo userInfo, PageRequest pageRequest) {
        return null;
    }

    @Override
    public UserInfo insert(UserInfo userInfo) {
        return null;
    }

    @Override
    public UserInfo update(UserInfo userInfo) {
        return null;
    }

    @Override
    public boolean deleteById(String userId) {
        return false;
    }
}
